<!--#include("_header.html")-->
<load target="../../layout/tpl/js/layout_modify.js" />
<form method="post" action="{Context::getRequestUri()}" enctype="multipart/form-data" class="form">
	<div cond="$XE_VALIDATOR_MESSAGE" class="message {$XE_VALIDATOR_MESSAGE_TYPE}">
		<p>{$XE_VALIDATOR_MESSAGE}</p>
	</div>
	
	<h4 class="xeAdmin">{$lang->cafe_info}</h4>
	<input type="hidden" name="module" value="homepage" />
	<input type="hidden" name="layout_srl" value="{$selected_layout->layout_srl}" />
	<input type="hidden" name="vid" value="{$site_module_info->domain}" cond="isSiteID($site_module_info->domain)" />
	<input type="hidden" name="site_srl" value="{$homepage_info->site_srl}" />
	<input type="hidden" name="act" value="procHomepageUpdateSiteConfig" />
	<div class="table">
		<table cellspacing="0" class="rowTable">
		<tr>
			<th><div>{$lang->cafe_title}</div></th>
			<td class="wide"><input type="text" name="cafe_title" value="{htmlspecialchars($homepage_info->title)}" class="inputTypeText" /></td>
		</tr>
		<tr>
			<th><div>{$lang->cafe_description}</div></th>
			<td class="wide"><textarea name="cafe_description" class="inputTypeTextArea" style="width:90%;">{htmlspecialchars($homepage_info->cafe_description)}</textarea></td>
		</tr>
		<tr>
			<th><div>{$lang->cafe_banner}</div></th>
			<td class="wide">
			<div id="preview_{$name}" cond="$homepage_info->cafe_banner">
				<img src="{$homepage_info->cafe_banner}" alt="cafe banner" style="display:block;margin-bottom:10px;" cond="$homepage_info->cafe_banner"/>
				<input type="checkbox" name="banner_del" value="Y"/>{$lang->cmd_delete}
			</div>
			<input type="file" name="cafe_banner" class="inputTypeText" />
			</td>
		</tr>
		</table>
	</div>

	<h4 class="xeAdmin">{$lang->cmd_select_index}</h4>
	<div class="table">
		<table cellspacing="0" class="rowTable">
		<tr>
			<td>
			<select name="index_mid">
			<option value="{$val->module_srl}" loop="$mid_list=>$no,$val" selected="selected"|cond="$val->module_srl==$homepage_info->module_srl">{$val->browser_title} ({$val->mid})</option>
			</select>
			</td>
		</tr>
		</table>
	</div>

	<h4 class="xeAdmin">{$lang->default_language}</h4>
	<p class="summary">{$lang->About_default_language}</p>
	<div class="table">
		<table cellspacing="0" class="rowTable">
		<tr>
			<td>
			<select name="language">
			<!--@foreach($lang_supported as $key => $val)-->
			<option value="{$key}" <!--@if($key==$site_module_info->default_language)-->selected="selected"<!--@end-->>{$val}</option>
			<!--@endforeach-->
			</select>
			</td>
		</tr>
		</table>
	</div>
	<div class="btnArea">
		<span class="btn"><input type="submit" value="{$lang->cmd_save}" /></span>
	</div>
</form>

<form id="config_form" ruleset="updateLayout" action="./" class="form" enctype="multipart/form-data" method="post">
	<input type="hidden" name="module" value="layout" />
	<input type="hidden" name="act" value="procHomepageUpdateLayoutConfig" />
	<input type="hidden" name="layout_srl" value="{$selected_layout->layout_srl}" />
	<input type="hidden" name="_layout_type" value="{$selected_layout->layout_type}" />
	<!--// For submit config. Do not delete this division. -->
	<div></div>
</form>

<div id="layout_config" class="form">
	<!--// layout setting -->
	<h4 class="xeAdmin">{$lang->layout}</h4>
	<div class="table">
		<table cellspacing="0" class="rowTable">
		<!--@if($homepage_config->enable_change_layout == 'Y')-->
		<tr>
			<th><div>{$lang->layout}</div></th>
			<td colspan="2" class="text">
			<select name="layout">
				<option value="faceoff">faceoff</option>

				<optgroup label="{$lang->downloaded_list}">
				<!--@foreach($layout_list as $key => $val)-->
				<option value="{$val->layout}" selected="selected"|cond="$selected_layout->layout == $val->layout"> <!--@if($val->title)-->{$val->title} ({$val->layout})<!--@else-->{$val->layout}<!--@end--></option>
				<!--@end-->
				</optgroup>
			</select>
			</td>
		</tr>
		<!--@end-->
		<tr>
			<th scope="row"><div>{$lang->path}</div></th>
			<td colspan="2" class="text">{$selected_layout->path}</td>
		</tr>
		<tr class="row2" cond="count($selected_layout->author)">  
			<th scope="row"><div>{$lang->author}</div></th>
			<td colspan="2" class="text">
			<!--@foreach($selected_layout->author as $k => $v)-->
			<a href="{$v->homepage}" onclick="window.open(this.href);return false;">{$v->name}</a>
			<!--@end-->
			</td>
		</tr>
		<tr class="row2" cond="$selected_layout->description">  
			<th scope="row"><div>{$lang->description}</div></th>
			<td colspan="2" class="text">{nl2br(trim($selected_layout->description))}</td>
		</tr>
		</table>

		<input type="hidden" name="title" value="{htmlspecialchars($homepage_info->title)}" />
		<input type="hidden" name="apply_layout" value="Y" />
		<!--@foreach($selected_layout->menu as $menu_name => $menu_info)-->
		<input type="hidden" name="{$menu_name}" value="{$menu_info->menu_srl}" />
		<!--@end-->
		<table cellspacing="0" class="rowTable">
		<tr class="row2">
		<th scope="row"><div>{$lang->header_script}</div></th>
			<td colspan="2" class="text">
			<textarea name="header_script" class="inputTypeTextArea w400">{htmlspecialchars($selected_layout->header_script)}</textarea>
			<p>{$lang->about_header_script}</p>
			</td>
		</tr>
		<!--@foreach($selected_layout->extra_var as $name => $var)-->
		{@ $_rows[$var->group]++ }
		<!--@end-->

		<!--@foreach($selected_layout->extra_var as $name => $var)-->
		<!--@if($var->group && ((!$_group) || $_group != $var->group))-->
		{@$_group_idx = 0;}
		{@$_group = $var->group}
		<tr>
			<th rowspan="{$_rows[$var->group]+1}"><div>{$_group}</div></th>
		</tr>
		<!--@end-->
		<!--@if($_group_idx>0)-->
		<tr>
		<!--@end-->
			<td class="nowrap"><div>{$var->title}</div></td>
			<td <!--@if(!$var->group)-->colspan="2"<!--@end--> class="text">
			<!--@if($var->type == "text")-->
			<input type="text" name="{$name}" value="{htmlspecialchars($var->value)}"  id="vars_{$name}"class="inputTypeText w400"/>
			<a href="{getUrl('','module','module','act','dispModuleAdminLangcode','target','vars_'.$name)}" onclick="popopen(this.href);return false;" class="buttonSet buttonSetting"><span>{$lang->cmd_find_langcode}</span></a>

			<!--@elseif($var->type == "textarea")-->
			<textarea name="{$name}" class="inputTypeTextArea w400" id="vars_{$name}">{htmlspecialchars($var->value)}</textarea>
			<a href="{getUrl('','module','module','act','dispModuleAdminLangcode','target','vars_'.$name)}" onclick="popopen(this.href);return false;" class="buttonSet buttonSetting"><span>{$lang->cmd_find_langcode}</span></a>

			<!--@elseif($var->type=="image")-->
			<input type="hidden" name="{$name}" id="file_{$name}" value="{$var->value}" />
			<div id="preview_{$name}" style="display:none;"|cond="!$var->value">
				<img src="../../../{$var->value}"|cond="$var->value" alt="" style="max-width: 250px" />
				<input type="button" value="{$lang->cmd_delete}" onclick="deleteImage('{$name}')" />
			</div>
			<form action="./" enctype="multipart/form-data" method="post" target="hiddenIframe" class="imageUpload">
			<input type="hidden" name="module" value="layout" />
			<input type="hidden" name="act" value="procLayoutAdminConfigImageUpload" />
			<input type="hidden" name="layout_srl" value="{$layout_srl}" />
			<input type="hidden" name="name" value="{$name}" />
				<p>
					<input type="file" name="img" id="file_select_{$name}" value="" />
					<input type="submit" value="{$lang->cmd_submit}" />
				</p>
			</form>
			<!--@elseif($var->type == "select")-->
			<select name="{$name}">
				<!--@foreach($var->options as $key => $val)-->
				<option value="{$key}" <!--@if($key==$var->value)-->selected="selected"<!--@end-->>{$val->val}</option>
				<!--@end-->
			</select>
			<!--@end-->
			<p>{$var->description}</p>
			</td>
		</tr>
		<!--@end-->
		</table>
	</div>
	<div class="btnArea">
		<span class="btn"><input type="submit" value="{$lang->cmd_save}" onclick="doSubmitConfig()" /></span>
	</div>
</div>
<iframe name="hiddenIframe" src="about:blank" width="1000px" height="1000px" frameborder="0" style="position:absolute;top:-9999px;left:-9999px"></iframe>
<!--#include("_footer.html")-->
